using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using HISModels.Entities;

namespace HISModels.Mapping
{
	public class GrnDetailMap : EntityTypeConfiguration<GrnDetail>
	{
		public GrnDetailMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.ItemCode)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("GrnDetails");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.GrnId).HasColumnName("GrnId");
			this.Property(t => t.ExpirationDate).HasColumnName("ExpirationDate");
			this.Property(t => t.ItemCode).HasColumnName("ItemCode");
			this.Property(t => t.UnitOfMeasurementType).HasColumnName("UnitOfMeasurementType");
			this.Property(t => t.Qty).HasColumnName("Qty");
			this.Property(t => t.Description).HasColumnName("Description");
		}
	}
}

